﻿/*********************************************************************************************************************
 * OPTIM
 *********************************************************************************************************************
 * Page: SyncList.UserInterface.ValueConverters.IconValueConverter
 * 
 * Description :
 * -------------
 * Convertir en icône
 * 
 * Historique :
 * ------------
 * 10/12/2011 9:33:01 PM - Emmanuel - V__.__.__ - Création
 * 
 * 
 *********************************************************************************************************************/

using System.Windows.Data;
using SyncList.Business.ValueObject;
using System.Windows.Media;
using SyncList.UserInterface.Helpers;
namespace SyncList.UserInterface.ValueConverters
{
    /// <summary>
    /// Convertir en icône
    /// </summary>
    /// <Creation>10/12/2011 9:33:01 PM Emmanuel</Creation>
    public class IconValueConverter : IValueConverter
    {

        /// <summary>
        /// Convertir en icône
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Brush result = null;
            ItemBase item = value as ItemBase;
            if (item != null)
                result = IconHelper.GetIcon(item);
            return (result);
        }



        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new System.NotImplementedException();
        }
    }
}
